//
//  UIImage+KQExtension.m
//  KangQiaoVHu
//
//  Created by 郭树清 on 16/9/6.
//  Copyright © 2016年 KuoShuChing. All rights reserved.
//

#import "UIImage+KQExtension.h"

@implementation UIImage (KQExtension)
//不被渲染
-(UIImage *)originarImage
{
    return [self imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
}
-(UIImage *)resizbleImage
{
    return [self stretchableImageWithLeftCapWidth:self.size.width * 0.5 topCapHeight:self.size.height * 0.5];
}


//不被渲染
+(UIImage *)imageWithOriginalNamed:(NSString *)name
{
    UIImage * image = [UIImage imageNamed:name];
    return  [image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
}

//保护四周 拉伸中间一个像素点
+(UIImage *)resizbleImage:(NSString *)name
{
    UIImage * image = [UIImage imageNamed:name];
    return [image stretchableImageWithLeftCapWidth:image.size.width * 0.5 topCapHeight:image.size.height * 0.5];
}
@end
